home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 42 / Mac Magazin and MacEasy Magazine CD - Issue 42.iso / Software / Utilities / Verschönerungen / DPC Bundle 1.1 / DPC Bundle Documentation < prev    next >
Text File  |  1998-01-07  |  17KB  |  182 lines

  1. DPC Bundle Release 1.1
  2. ©1997–1998 Sarwat Khan
  3. January 1rst, 1998.
  4.  
  5. This is a simple set of utilities that automate changing your desktop picture in various ways. For more info, see the section What is this bundle? By the way, reading documentation isn’t a bad thing.
  6.  
  7. The Desktop Picture Changer Bundle is freeware. You need Mac OS 8 to use any of it. If you like it so much that you feel you need to give me something, take a look at http://www.interlog.com/~sarwat/painting. If you do use it, please send me some e-mail. Since it’s freeware, this is the only way I can know if people like it (and that I should keep working on it).
  8.  
  9. Contents    
  10. • If you don’t like manuals
  11. • What is this bundle?
  12. • The Desktop Picture Changer applet
  13. • The Desktop Picture Aligner
  14. • The DPC Preferences applet
  15. • The DPC Speech Settings applet
  16. • The Internals of the Main Applet
  17. • Scripting Tips
  18. • Usage tips
  19. • Reporting Tips & Bugs
  20. • Redistributing the DPC Bundle
  21. • Legal Stuff
  22. • Contacting the Author
  23.  
  24. If you don’t like manuals
  25. Before you do anything, run the Desktop Picture Changer applet! It will ask you three questions that need to be answered to make it functional. Also, if you run the main applet in automatic mode (see the section What is this bundle?), I recommend putting an alias to the applet in the Startup Items folder.
  26.  
  27. The most useful section of this document would be What is this bundle? I recommend you read that so you know what this does ;-)
  28.  
  29. What is this bundle?
  30. What does it do? The main purpose of this stuff is to automate changing your desktop picture from files in a folder. It can do this in several ways. You can have it set to change it automatically every few minutes or just when you double click it. You can have it pick files randomly from the folder or you can have it go through each one in order. Finally, you can set positioning and alignment options for each of your pictures using the Desktop Picture Aligner program.
  31.  
  32. How do I get started? 
  33. • First of all, you need Mac OS 8.
  34. • Secondly, you need to have a bunch of images that work with the Desktop Pictures control panel in a folder (these can just be aliases if you like).
  35. • Launch the “Desktop Picture Changer” applet to set it up. It will ask you a series of questions. It will tell you what to do, but I’ll summarize the process here for completeness.
  36.  
  37. The first thing it will ask you is where the folder with the pictures is. Go ahead and locate the folder that I mentioned in the second step.
  38.  
  39. Next, it will ask how you want to choose the pictures in that folder. Do you want to go through them in order or do you want to be surprised, by having it pick one at random?
  40.  
  41. Lastly, it will ask you if you want to Desktop Picture Changer (DPC) to run in manual mode or automatic mode. In manual mode, you launch DPC, it changes the desktop picture according to your settings, and it quits. In automatic mode, it sits running in the background, and changes the desktop picture every once in a while (depending on how many minutes you specify).
  42.  
  43. Note: You can change these settings anytime using the DPC Preferences script, but they need to be set up this way first.
  44.  
  45. • You’re all set! The desktop picture will be changed according to your settings. If it’s in manual mode, you’ll need to run the applet every time you want to change it. With this method, you can put it in the startup items folder to have it change at startup. If it’s in automatic mode, I suggest putting an alias of it in the startup items folder.
  46.  
  47. The Desktop Picture Changer applet
  48. It’s actually a droplet. This is what does all the work. Before you run any of the utilities, run this one first to configure it. For more information on this, see the previous section What is this bundle?
  49.  
  50. Here’s a quick glossary:
  51.  
  52. Automatic Mode Running the applet will change the desktop picture and keep it running. Then, after the specified time has passed (this is setup when you first run the applet), it will change the desktop picture.
  53.  
  54. Manual Mode Running the applet will change the desktop picture then quit.
  55.  
  56. The Choosing Method You can have it pick pictures from the folder in order by their names, or you can have it pick them randomly.
  57.  
  58. The Picture Folder The applet picks pictures from the folder that you set as its picture folder. If you want to change the folder, just drag a folder or a picture onto the applet.
  59.  
  60. The Desktop Picture Aligner
  61. This is probably the most useful part of this package. You don’t to use the applets for this to be functional. With this tool you can set the default position and alignment settings of a picture. It requires Mac OS 8 to run (actually, it only needs the Appearance Manager).
  62.  
  63. For example, try dropping a picture file onto the Desktop Picture Aligner’s icon. A dialog will come up that has a popup menu and a bunch of radio buttons. The menu is for positioning, and the radio buttons are for alignment. The “Position:” menu works just like the one in the control panel. 
  64.  
  65. The alignment options are only available here.* This option lets you make your picture cling to one of the sides or corners of the screen. So, if you set your picture’s positioning to “Scaled” and its alignment to the left side of the screen, when you open the picture with the Desktop Pictures control panel the image will be scaled as large as it can be and its left edge will touch the left edge of your screen. To use alignment, first check the “Align to Desktop” check box, then click the appropriate radio button to indicate which part of the desktop that you want your picture to cling to.
  66.  
  67. * Well, okay, I lied. You can align pictures in the control panel by using holding down the option key and pressing the arrows to move the picture around.
  68.  
  69. Alignment affects all of the Positioning settings except “Fill Screen.”
  70.  
  71. The position and alignment settings are stored in the resource fork of the picture file (if you don’t know what that means, don’t worry, it just means that the information is contained in the file with the picture, and it doesn’t affect the picture’s data). The settings that are in the picture are just defaults for the control panel to use. You can override them with the Desktop Pictures control panel.
  72.  
  73. If you want “standard” behaviour for a picture, just select “None” from the Postion popup, and make sure the “Align to Desktop” button is unchecked.
  74.  
  75. More Options
  76. If you click the “More Options” button in the dialog that comes up after you open a file, a second popup menu named “Creator:” will be added to the dialog. This lets you change the creator of a file that you are working with.
  77.  
  78. Every Macintosh file has a “creator” attribute given to it. This attribute tells the Mac OS what application program to launch if you double click the file (it also helps it figure out what icon to use for the file). You can use this popup menu to change the creator for the file you opened. This is useful if you want your file to be opened with the Desktop Pictures control panel instead of whatever it’s opening with now when you double click it in the Finder.
  79.  
  80. Multiple Files
  81. You can drag several files from the Finder on to the Desktop Picture Aligner icon to process more than one file at once. So, if you have five files that you want to set to have centered positioning and lower right alignment, just select those five files in the Finder and drag and drop them onto DPA’s icon. DPA will bring the same dialog up as it normally does, but this time the changes will affect all the files that you dropped on the icon (it won’t bring up five dialogs).
  82.  
  83. This utility is hopefully safe, but I don’t make any warranties. Use it at your own risk and read the legal disclaimer. I use it on all my precious desktop pictures though :)
  84.  
  85. The DPC Preferences applet
  86. Use this script to change the settings of the Desktop Picture Changer applet. It’s pretty straight forward. In order to change your picture folder, just drag a new one onto the Desktop Picture Changer applet/droplet (not the DPC Preferences applet).
  87.  
  88. Note: Don’t run this script until you have run the Desktop Picture Changer applet for the first time.
  89.  
  90. DPC Speech Settings applet 
  91. By default, DPC reports all errors through the speech manager if the “Say” scripting addition is available. Otherwise it uses those nasty modal dialogs. Use this script to switch between the two options.
  92.  
  93. You may not want speech because it’s easy to miss out on errors if you’re not paying attention. However, if you have Apple’s Speech Recognition installed (see http://speech.apple.com), the errors will also pop up in the Speech Recognition floating window. I hate modal dialogs, so I prefer it this way. I don’t think you’d be running into that many errors unless if you’re trying to script it—these errors are usually AppleScript errors. Once you have everything up and running you’re not likely to be getting any.
  94.  
  95.  
  96. The Internals of the Main Applet
  97. This section describes the handlers you can use in scripting the Desktop Picture Changer applet yourself. You can open the applet in the Script Editor youself to look at the code.
  98.  
  99. on run
  100. This is the thing that runs when you double click it. 
  101.  
  102. The first time it runs, it checks to see if you have been “welcomed.” If you haven’t, it starts the setup process that asks you the three basic questions that you need to get some functionality out of the script. It asks for the location of the picture folder, if you want random or sequential choosing, and if you’d like automatic or manual control.
  103.  
  104. If it’s in manual mode, it will switch the picture and then quit right away. Otherwise, it will hang around for the idle handler to do its work.
  105.  
  106. on idle
  107. When the idle handler runs, it switches the picture. This is used to automatically switch the pictures.
  108.  
  109. on open «a file or a folder»
  110. If you dropped a folder onto the applet, it will set it to the picture folder. If you drag an image onto the applet, it will switch the desktop picture to the given one and change the picture folder to the picture that it was given. I’m considering changing this so that it won’t change the picture folder (in case if you drag an alias that was in your picture folder, you’ll change the picture folder to the folder that contained the original file of the alias, not the folder that contained the alias). Tell me what you think. In either case, it will put up a dialog confirming if that’s what you want to do. Make sure you read it :)
  111.  
  112. If it’s in manual mode, which means that you launched the thing by dragging a file/folder on top of it, it will quit when it is done.
  113.  
  114. on SwitchPicture()
  115. If you tell the applet to SwitchPicture(), it will launch the Desktop Pictures control panel (if needed) and change the picture either randomly or sequentially from the picture folder. It will quit the control panel if it wasn’t open before.
  116.  
  117. on SetPictureFolder(inPictureFolder)
  118. Sets the picture folder to the given one alias/reference. It better be a valid folder, because this doesn’t do any error checking.
  119.  
  120. on GetPictureFolder()
  121. Returns an alias or reference to the picture folder.
  122.  
  123. on SetChoosingMethod(inChoosingMethod)
  124. Sets the choosing method. Pass 1 for random, pass 2 for sequential.
  125.  
  126. on GetChoosingMethod()
  127. Returns either 1 or 2. 1 means that the choosing method is random, and 2 means that it is sequential.
  128.  
  129. on SetSleepTime(inTime)
  130. Sets the time in minutes of how long it should “sleep” between automatic picture changes. It takes effect after the next time it automatically changes the desktop picture (when the idle handler gets called next time).
  131.  
  132. on GetSleepTime()
  133. Returns the time in minutes of how long it waits between automatic changes.
  134.  
  135. on StartSetPrefs()
  136. If you call this, it prevents the idle handler from changing the picture until you call EndSetPrefs. See the “DPC Preferences” applet for an example. The idle handler will start working the next time you run the applet (after you’ve quit it) or drop a file onto the applet.
  137.  
  138. on EndSetPrefs()
  139. It lets the idle handler do its job again. It’s only useful if you called StartSetPrefs() before.
  140.  
  141. on SetUseSpeech(inUseIt)
  142. By default, DPC reports all errors through the speech manager if the “Say” scripting addition is available. Otherwise it uses those nasty modal dialogs. You can change the setting by passing “true” or “false” into the inUseIt variable.
  143.  
  144. You may not want speech because it’s easy to miss out on errors if you’re not paying attention. However, if you have Apple’s Speech Recognition installed (see http://speech.apple.com), the errors will also pop up in the Speech Recognition floating window. I hate modal dialogs, so I prefer it this way. I don’t think you’d be running into that many errors unless if you’re trying to script it.
  145.  
  146. There’s an AppleScript applet provided to toggle these settings for you.
  147.  
  148. on IsUsingSpeech()
  149. Returns a boolean “true” or “false.”
  150.  
  151. Usage tips
  152. • For your pictures folder, it’s a good idea to make it contain nothing but aliases your files. Then you can rename and duplicate them as you want, which is useful for the next two tips.
  153. • If you have DPC using sequential choosing, you can name the aliases to order them alphabetically.
  154. • If you have DPC using random choosing, you can duplicate some of the aliases to increase the odds of those pictures being picked.
  155. • Keep an alias of the Desktop Picture Changer in your startup items folder. If it’s in automatic mode, this will keep the applet running whenever you use your Mac. If it’s in manual mode, you’ll get a new desktop picture every time you startup.
  156. • Whenever the desktop picture needs to be changed, the control panel has to be launched. If it’s already opened when the Desktop Picture Changer changes the picture, it will leave it open. You might prefer to keep it running if you have it set up to change the desktop picture very often.
  157. • In order for the control panel to open and close faster, open the control panel and make sure the “Pattern” button is clicked. If the control panel opens in “Picture” mode every time, it will have to take time to display the current desktop picture (which takes a while), and then it will have to take more time again to display the new desktop picture. It doesn’t matter if the control panel is covered by other windows or not; it will still take the time to draw the picture. If it opens in “Pattern” mode, it doesn’t have to display the desktop picture, so it’s faster.
  158. • Note that if all you want is a random picture at startup, using the DPC applet is overkill. All you need to do is to drag your picture folder to the Desktop Pictures control panel window (onto the picture of the desktop) and it will pick one from that folder randomly (and change it every time you start up). You can still use the Desktop Picture Aligner to set how you want your images to be positioned on your desktop.
  159.  
  160. Reporting Tips & Bugs
  161. Please tell me about what you think of these tools. I’d really like the feedback. As of this writing, I’ve had 3. I was going to release the DPC applet as run-only and wait for people to tell me what they wanted, and then release and editable version when I was happy with the code. That was back in August ’97, a week after I installed Mac OS 8 and wrote all these tools. I ignored developing them and kept using them until late October, when I finally decided to release them.
  162.  
  163. I’ve been very happy running these applets for months now, and I don’t think there’s any real bugs in usability. But, I haven’t been playing with all of the handlers, so please let me know of any quirks you find.
  164.  
  165. Known Problems: If you’re doing heavy processing on your slow Mac (a PowerBook 1400 @ 117  Mhz is slow) and you have the applet in automatic mode, the applet may sometimes (rarely) report time out errors. I’m not going to bother fixing this.
  166.  
  167. Also, it’s not designed to work with multiple monitor Macs. I would expect that people who are blessed with that functionality would be pretty specific about what picture appears on which monitor, and I don’t know the best way to automate that so everyone would be happy. If you want, you can customise the script. Just don’t give anyone your customised scripts (if you’re going to give the DPC Bundle to anyone, read the next section).
  168.  
  169. Send your thoughts to sarwat@kagi.com.
  170.  
  171. Redistributing the DPC Bundle
  172. You can redistribute the DPC Bundle as long as you do not make any modifications to it. Do not give people the scripts that you have run. Only give them the original Stuffit archive. If you give them the DPC Bundle scripts that you’ve run, they won’t be able to set their preferences properly. The DPC Bundle may not be redistributed commercially in any way without my written consent, with the exception of online services.
  173.  
  174. Legal Stuff
  175. LEGAL DISCLAIMER. Use DPC Bundle at your own risk. DPC Bundle comes with absolutely no warranty. Sarwat Khan is not liable for any damages whatsoever caused by DPC Bundle. If you live in a country, state or province that makes this disclaimer void in any way, you may not use the DPC Bundle.
  176.  
  177. Contacting the Author
  178. Send mail and comments to sarwat@kagi.com.
  179. Check out Painting’s web site at http://www.interlog.com/~sarwat/painting/
  180. Check out Sarwat’s web site at http://www.interlog.com/~sarwat/
  181. For current info on DPC bundle http://www.interlog.com/~sarwat/mac/mac.html
  182.